package mine.aop_spring;

import org.springframework.aop.framework.ProxyFactory;
import mine.aop.Greeting;
import mine.aop.GreetingImpl;

/**
 * Created by james on 16/2/3.
 */
public class Client {
    public static void main(String[] args) {
        ProxyFactory proxyFactory = new ProxyFactory();
        proxyFactory.setTarget(new GreetingImpl());
        proxyFactory.addAdvice(new GreetingBeforeAdvice());
        proxyFactory.addAdvice(new GreetingAfterAdvice());
        Greeting greeting = (Greeting) proxyFactory.getProxy();
        greeting.sayHello("Jack");

    }
}
